﻿@model ProjectBordspil.Models.MemViewModel
@using System.Web.Security;

@{
    ViewBag.Title = "MemGameView";
}

<h2 class="H2Mem">Ofurhetju Samstæðuspil</h2>
<h3 class="NameOfCurrentGame">Nafn á leik: @Model.theGame.name</h3>

<div class="ButtonsDiv" id="ButtonsDivs">
        @foreach (var item in Model.theImages)
        { 
            if(item.status == "down")
            {
                <div class="ButtonDiv"><button type="button" class="Button" id="@item.id" value="@item.theImageObject.value"><img class="ImageClass" src="@item.theImageObject.image" style="visibility:hidden" alt="Hér er mynd"/> </button></div>
            }
            if(item.status == "up")
            {
                <div class="ButtonDiv" ><button type="button" class="Button" id="@item.id" value="@item.theImageObject.value"><img class="ImageClass" src="@item.theImageObject.image" style="visibility:visible" alt="Hér er mynd"/> </button></div>
            }
            if(item.status == "found")
            {
                <div class="ButtonDiv" ><button type="button" class="Button" id="@item.id" value="@item.theImageObject.value"><img class="ImageClass" src="@item.theImageObject.image" style="visibility:visible" alt="Hér er mynd"/> </button></div>
            }
        }
</div>

<div class="Container">
    <h3 class="H2Mem">Spjall</h3>
        <ul id="Discussion"></ul>
        <input type="hidden" id="Displayname" />
        <input type="text" id="Message" />
        <input type="button" id="Sendmessage" value="Senda" />
</div>
<div id="GameStatus">
    <div id="Line1"><div style="visibility:hidden" id="YourTurn1">Þú átt að gera -></div> <div id="User1" class="H2Mem">Notandi1:<span id ="SUser1">@Model.theGame.user1</span> Stig:<span id ="ScoreUser1">@Model.theGame.userOneScore</span></div></div>
    <div id="Line2"><div style="visibility:hidden" id="YourTurn2">Þú átt að gera -></div> <div id="User2" class="H2Mem">Notandi2:<span id ="SUser2">@Model.theGame.user2</span> Stig:<span id ="ScoreUser2">@Model.theGame.userTwoScore</span></div></div>
</div>

 <script>
     var group = '@(Model.theGame.id)';
     var g_username = '@User.Identity.Name';
     var user = "@Membership.GetUser().UserName";
 </script>

<script src="/Scripts/MemoryGameScripts.js"></script>
<script src="/Scripts/ChatHubScript.js"></script>
